<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<script type="text/javascript">
			// 创建一个空的数组
			var array = new Array();
			array[0] = "312"
			console.log(array);//["312"]
			console.log(array.length);//1
			array[1] = true;
			console.log(array);//["312", true]
			console.log(array.length);//2
			
			// 使用push和pop分别对应栈操作的入栈和出栈
			var array1 = new Array();
			array1.push("zhangsan");
			console.log(array1);// ["zhangsan"]
			array1.push(34);
			console.log(array1);// ["zhangsan", 34]
			array1.push(false);
			console.log(array1);// ["zhangsan", 34, false]
			console.log(array1[1]);
			console.log(array1);// ["zhangsan", 34, false]
			console.log(array1.pop());// false
			console.log(array1);// ["zhangsan", 34]
		</script>
	</body>
</html>
